//package com.project.stream_producer.demo1.service.impl;
//
//import com.project.stream_producer.demo1.service.MessageProducer;
//import org.springframework.cloud.stream.annotation.EnableBinding;
//import org.springframework.cloud.stream.messaging.Source;
//import org.springframework.messaging.MessageChannel;
//import org.springframework.messaging.support.MessageBuilder;
//
//import javax.annotation.Resource;
//import java.util.UUID;
//
//@EnableBinding(Source.class)
//public class MessageProducerImpl implements MessageProducer {
//    @Resource
//    private MessageChannel output;//消息发送管道
//
//    @Override
//    public boolean send() {
//        for (int i = 0; i < 10; i++) {
//            boolean send = output.send(MessageBuilder.withPayload(i).build());
//            System.out.println(i);
//        }
//
//        return true;
//    }
//}
